<!DOCTYPE html>
 <html>
 <head>
 <meta http-equiv="X-UA-Compatible" content="IE=edge">
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
 <% include("/WEB-INF/view/console/common/css.html"){}	%>
 <% include("/WEB-INF/view/console/common/js.html"){} 	%>
 <title></title>
 </head>
 <body> <nav class="navbar navbar-default navbar-fixed-top site-navbar" >
  <div class="navbar-header">
 <a class="navbar-brand" href="#">boProxy</a>
 </div>
  </nav>
 <form name="boProxy_form"  id="boProxy_form" class="form-horizontal" style="margin-top: 60px;">
   <div class="form-group" >
 <label class="col-sm-2 control-label">用户昵称</label>
 <div class="col-sm-6">
 <input  type="text"  name="boProxyNickName" id="boProxyNickName" class="form-control" check-type="required" value='${boProxy.boProxyNickName!}' >
 </div>
  </div>
 <div class="form-group" >
 <label class="col-sm-2 control-label">电话号码</label>
 <div class="col-sm-6">
 <input  type="text"  name="boProxyPhone" id="boProxyPhone" class="form-control" check-type="required" value='${boProxy.boProxyPhone!}' >
 </div>
  </div>
 <div class="form-group" >
 <label class="col-sm-2 control-label">邮箱</label>
 <div class="col-sm-6">
 <input  type="text"  name="boProxyMail" id="boProxyMail" class="form-control"  value='${boProxy.boProxyMail!}' >
 </div>
  </div>
 <div class="form-group" >
 <label class="col-sm-2 control-label">密码</label>
 <div class="col-sm-6">
 <input  type="text"  name="boProxyPassword" id="boProxyPassword" class="form-control" check-type="required" value='${boProxy.boProxyPassword!}' >
 </div>
  </div>
 <div class="form-group" >
 <label class="col-sm-2 control-label">用户类型</label>
 <div class="col-sm-6">
 <label><input checked='checked' auto_name='boProxy_boProxyType' type="radio"  name="boProxyType" value="1"/>普通用户</label>
  
 </div>
  </div>
 	<script type="text/javascript">
       $(function($){
       $('input[auto_name="boProxy_boProxyType"]').each(function(){
       if('${boProxy.boProxyType!}'==this.value){ 
             $(this).attr('checked','checked');
            }
           });
 	    });
 	</script> 
 <div class="form-group" >
 <label class="col-sm-2 control-label">是否可用</label>
 <div class="col-sm-6">
 <label><input checked='checked' auto_name='boProxy_boProxyState' type="radio"  name="boProxyState" value="1"/>是</label>
 <label><input  auto_name='boProxy_boProxyState' type="radio"  name="boProxyState" value="0"/>否</label>
  
 </div>
  </div>
 	<script type="text/javascript">
       $(function($){
       $('input[auto_name="boProxy_boProxyState"]').each(function(){
       if('${boProxy.boProxyState!}'==this.value){ 
             $(this).attr('checked','checked');
            }
           });
 	    });
 	</script> 
 <div class="form-group" >
 <label class="col-sm-2 control-label">性别</label>
 <div class="col-sm-6">
 <label><input checked='checked' auto_name='boProxy_boProxySex' type="radio"  name="boProxySex" value="0"/>男</label>
 <label><input  auto_name='boProxy_boProxySex' type="radio"  name="boProxySex" value="1"/>女</label>
  
 </div>
  </div>
 	<script type="text/javascript">
       $(function($){
       $('input[auto_name="boProxy_boProxySex"]').each(function(){
       if('${boProxy.boProxySex!}'==this.value){ 
             $(this).attr('checked','checked');
            }
           });
 	    });
 	</script> 
 <div class="form-group" >
 <label class="col-sm-2 control-label">是否禁止评论</label>
 <div class="col-sm-6">
 <label><input checked='checked' auto_name='boProxy_boBanComment' type="radio"  name="boBanComment" value="1"/>是</label>
 <label><input  auto_name='boProxy_boBanComment' type="radio"  name="boBanComment" value="0"/>否</label>
  
 </div>
  </div>
 	<script type="text/javascript">
       $(function($){
       $('input[auto_name="boProxy_boBanComment"]').each(function(){
       if('${boProxy.boBanComment!}'==this.value){ 
             $(this).attr('checked','checked');
            }
           });
 	    });
 	</script> 
  <div class="form-group" >
 <label class="col-sm-2 control-label">头像</label>
 <div class="col-sm-3">
   <span class="btn btn-success fileinput-button">
        <i class="glyphicon glyphicon-plus"></i>
        <span>添加</span>
  <input type="file" id="boProxyHeadImage_file" class="form-control" value='${boProxy.boProxyHeadImage!}' >
  <input type="hidden" id="boProxyHeadImage"  name="boProxyHeadImage"class="form-control" value='${boProxy.boProxyHeadImage!}' >
    </span>
  <div id="boProxyHeadImage_progress" class="progress">
   <div class="progress-bar progress-bar-success"></div>
  </div>
  </div>
   	<div class="col-sm-4">
   	<img id="boProxyHeadImage_file_show" src="${boProxy.boProxyHeadImage!}" style="width:100px;" alt="图片" class="img-rounded">
 </div>
 </div>

   <script type="text/javascript"> 
 $(function($){
  consoleUploadAliImg('boProxyHeadImage','${ctxPath}');
 });
 </script> 
   <input type='hidden' name='boProxyId' id='boProxyId' value='${boProxy.boProxyId!}'><input type='hidden' name='common_token' id='common_token' value='${common_token!}'>
 <div class="form-group" style="margin-bottom: 60px;"></div>
 </form>
 <script type="text/javascript">
 $(function($) {
    /*开启表单验证*/
 	$("#boProxy_form").validation();
 });
 /*保存*/
 function saveZqForm(){
    if ($("#boProxy_form").valid() == false) {
 	    return false;
    }
    var formObject=new Object();
    formObject.boProxyNickName=$('#boProxyNickName').val()==''?null:$('#boProxyNickName').val(); 
 formObject.boProxyPhone=$('#boProxyPhone').val()==''?null:$('#boProxyPhone').val(); 
 formObject.boProxyMail=$('#boProxyMail').val()==''?null:$('#boProxyMail').val(); 
 formObject.boProxyPassword=$('#boProxyPassword').val()==''?null:$('#boProxyPassword').val(); 
 formObject.boProxyType=($('input[name="boProxyType"]:checked').val()==''?null:$('input[name="boProxyType"]:checked').val()); 
 formObject.boProxyState=($('input[name="boProxyState"]:checked').val()==''?null:$('input[name="boProxyState"]:checked').val()); 
 formObject.boProxySex=($('input[name="boProxySex"]:checked').val()==''?null:$('input[name="boProxySex"]:checked').val()); 
 formObject.boProxyHeadImage=$('#boProxyHeadImage').val()==''?null:$('#boProxyHeadImage').val(); 
 formObject.boBanComment=($('input[name="boBanComment"]:checked').val()==''?null:$('input[name="boBanComment"]:checked').val()); 
 formObject.boProxyId=$('#boProxyId').val()==''?null:$('#boProxyId').val(); 
 
    var formObjectJson = JSON.stringify(formObject);
    $.post("${ctxPath}/console/bo_proxy/save",
     {
           formObjectJson :formObjectJson,
 	   table_name :'boProxy',
 	   common_token :$("#common_token").val()
     }, function(data) {
            $.confirm({
                title: '提示',
                content: data.message,
                autoClose: 'cancelAction|3000',
                escapeKey: 'cancelAction',
                buttons: {
                    cancelAction: {
                        text: '确定',
                        action: function () {
                            parent.$("#boProxy").bootstrapTable("refresh");
                            parent.art.dialog.get('id-dialog-boProxy').close();
                        }
                    }
                }
            });
     });
 }
 </script>
 <nav class="navbar navbar-default navbar-fixed-bottom site-navbar" >
 <div class="container" style="padding-top:10px;padding-bottom:10px;">
 <div class="nav navbar-nav navbar-right">
 <a href="#" class="btn btn-success"  onclick='saveZqForm()'>保存 </a>
  </div>
  </div>
  </nav>
 </body>
